Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify the NooBaa DB PostreSQL version at upgrade #10440

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sagihirshfeld
Copy link
Contributor

@sagihirshfeld sagihirshfeld commented Sep 8, 2024

Noticeable changes made:

  1. Added three util functions:
  • get_nb_db_psql_version_from_image: extract the version from the image name in the noobaa-db-pg statefulset. The equivalent of:
 oc -n openshift-storage get statefulsets.apps noobaa-db-pg -o yaml | grep image:

    image: .../postgresql-12@sha256:28ab5b075817fb23ac1b8619371c858d39205d962309de35dea4434a95d67ee2
  • query_nb_db_psql_version: Extract the version from the DB itself. The equivalent of:
$ oc -n openshift-storage exec noobaa-db-pg-0 -- psql -t  -c "SELECT substring(version() from 'PostgreSQL ([0-9\.]+)')"
15.6
  • get_expected_nb_db_psql_version: Extract the PostreSQL version that's listed at the NooBaa CR, which by the noobaa-db reocvery KCS, seems to set the expectation. This util function is the equivalent of the following command:
oc -n openshift-storage get noobaa noobaa -o jsonpath='{$.spec.dbImage}'
.../postgresql-15@sha256:e0e8977ab6bd347218a3c8da305ebe75bfd2483c63fb63a93147051684626e88
  1. Added the verify_nb_db_psql_version helper function, and added it to the verification in run_ocs_upgrade.

  2. Added a libtest to test verify_nb_db_psql_version

@sagihirshfeld sagihirshfeld added Needs Testing Run tests and provide logs link MCG Multi Cloud Gateway / NooBaa related issues labels Sep 8, 2024
@sagihirshfeld sagihirshfeld self-assigned this Sep 8, 2024
@sagihirshfeld sagihirshfeld requested a review from a team as a code owner September 8, 2024 17:06
@pull-request-size pull-request-size bot added the size/L PR that changes 100-499 lines label Sep 8, 2024
Copy link

@ocs-ci ocs-ci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR validation on existing cluster

Cluster Name: shirshfe-417ibm29
Cluster Configuration:
PR Test Suite:
PR Test Path: tests/libtest/test_nb_db_psql_version.py
Additional Test Params:
OCP VERSION: 4.17
OCS VERSION: 4.17
tested against branch: master

Job PASSED.

@sagihirshfeld sagihirshfeld added Verified Mark when PR was verified and log provided and removed Needs Testing Run tests and provide logs link labels Sep 8, 2024
@sagihirshfeld sagihirshfeld changed the title Verify that NooBaa DB PostreSQL version at upgrade Verify the NooBaa DB PostreSQL version at upgrade Sep 8, 2024
udaysk23
udaysk23 previously approved these changes Oct 17, 2024
@openshift-ci openshift-ci bot added the lgtm label Nov 4, 2024
Copy link

openshift-ci bot commented Nov 4, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: sagihirshfeld, udaysk23

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm MCG Multi Cloud Gateway / NooBaa related issues size/L PR that changes 100-499 lines Verified Mark when PR was verified and log provided
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants